﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Axis.Dao.Research;
using Axis.BusinessObject.Research;
using PhuLeBooze.Global;

namespace PhuLeBooze.Views.Gift
{
    public partial class GiftManage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
               
                CResearchDao CResearch = new CResearchDao();
                IList<CProject> listProject = CResearch.GetProject(string.Format("<InputValue UserID='{0}' SecrectToken='{1}'/>", CSecurity.USER_ID, CSecurity.SECRECT_TOKEN));
                ddlProjectList.DataSource = listProject;
                ddlProjectList.DataTextField = "Name";
                ddlProjectList.DataValueField = "ID";
                ddlProjectList.DataBind();
                ddlProjectList.Items.Insert(0, new ListItem("(Tất cả)", "-1"));
                ddlProjectList.Items.Insert(1, new ListItem("ĐỔI ĐIỂM", "0"));
                CResearchDao cResearchDao = new CResearchDao();
                IList<CGift> listGift = cResearchDao.GetGift(string.Format("<InputValue UserID='{0}' SecrectToken='{1}'/>", CSecurity.USER_ID, CSecurity.SECRECT_TOKEN));
                ddlGift.DataSource = listGift;
                ddlGift.DataTextField = "Name";
                ddlGift.DataValueField = "ID";
                ddlGift.DataBind();
                ddlGift.Items.Insert(0, new ListItem("(Tất cả)", "-1"));
              
            }
        }
    }
}